/**
 * 项目名：phms3
 * 日期：    2019-11-23 10:35:54
 * Copyright (c) 2015- HTSC-版权所有
 */

package com.joysuch.wwyt.mh.entity;

import cn.zlg.common.springmvc.validate.constraints.NotNull;
import com.joysuch.wwyt.core.support.AutoSetCommonFieldListener;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.SQLDeleteAll;
import org.hibernate.annotations.Where;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;

import static javax.persistence.GenerationType.IDENTITY;

@EntityListeners({AuditingEntityListener.class, AutoSetCommonFieldListener.class})
@Entity
@Table(name = "wwyt_mh_major_hazard_chem_product")
@SQLDelete(sql = "update wwyt_mh_major_hazard_chem_product set DELETE_FLAG = '1' where id= ?")
@SQLDeleteAll(sql = "update wwyt_mh_major_hazard_chem_product set DELETE_FLAG = '1' where id= ?")
@Where(clause = "DELETE_FLAG = '0'")

public class MhMajorHazardChemProduct implements java.io.Serializable {

    // columns START
    // ID
    private Long id;
    // 租户
    private Long tenentId;
    // 组织机构代码
    private String orgCode;
    //
    private String code;
    // 名称
    @NotNull(field = "名称")
    private String name;
    //
    private String alias;
    //
    private String engName;
    //
    @NotNull(field = "CAS号")
    private String casNo;
    //
    private String type;
    //
    @NotNull(field = "是否重点监督")
    private String hazardChemicalFlag;
    // 创建人
    private Long createBy;
    // 创建时间
    private java.time.LocalDateTime createTime;
    // 更新人
    private Long updateBy;
    // 更新时间
    private java.time.LocalDateTime updateTime;
    // 删除标记
    private String deleteFlag;
    //44不显示;1显示
    private Integer state;
    //附件id
    private Long attachmentId;

    //化学品类型
    private Long chemProductType;
    //作用
    private Long functions;
    //最大储存量
    private String max;
    //储存方式/地点
    private String storageType;

    //年产品生产能力（吨）
    private String yearlyProductionCapacity;
    //年产品生产能力气体（方）
    private String gasYearlyProductionCapacity;
    //年产品最大储量（吨）
    private String yearlyMax;
    //年产品最大储量气体（方）
    private String gasYearlyMax;

    @Column(name = "yearly_production_capacity")
    public String getYearlyProductionCapacity() {
        return yearlyProductionCapacity;
    }

    public void setYearlyProductionCapacity(String yearlyProductionCapacity) {
        this.yearlyProductionCapacity = yearlyProductionCapacity;
    }

    @Column(name = "gas_yearly_production_capacity")
    public String getGasYearlyProductionCapacity() {
        return gasYearlyProductionCapacity;
    }

    public void setGasYearlyProductionCapacity(String gasYearlyProductionCapacity) {
        this.gasYearlyProductionCapacity = gasYearlyProductionCapacity;
    }

    @Column(name = "yearly_max")
    public String getYearlyMax() {
        return yearlyMax;
    }

    public void setYearlyMax(String yearlyMax) {
        this.yearlyMax = yearlyMax;
    }

    @Column(name = "gas_yearly_max")
    public String getGasYearlyMax() {
        return gasYearlyMax;
    }

    public void setGasYearlyMax(String gasYearlyMax) {
        this.gasYearlyMax = gasYearlyMax;
    }

    @Column(name = "attachment_id")
    public Long getAttachmentId() {
        return attachmentId;
    }

    public void setAttachmentId(Long attachmentId) {
        this.attachmentId = attachmentId;
    }

    @Column(name = "state")
    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public void setId(Long value) {
        this.id = value;
    }

    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "Id", unique = true, nullable = false)
    public Long getId() {
        return this.id;
    }

    @Column(name = "TENENT_ID")
    public Long getTenentId() {
        return this.tenentId;
    }

    public void setTenentId(Long value) {
        this.tenentId = value;
    }

    @Column(name = "ORG_CODE", length = 100)
    public String getOrgCode() {
        return this.orgCode;
    }

    public void setOrgCode(String value) {
        this.orgCode = value;
    }

    @Column(name = "CODE", length = 100)
    public String getCode() {
        return this.code;
    }

    public void setCode(String value) {
        this.code = value;
    }

    @Column(name = "NAME", length = 128)
    public String getName() {
        return this.name;
    }

    public void setName(String value) {
        this.name = value;
    }

    @Column(name = "ALIAS", length = 128)
    public String getAlias() {
        return this.alias;
    }

    public void setAlias(String value) {
        this.alias = value;
    }

    @Column(name = "ENG_NAME", length = 128)
    public String getEngName() {
        return this.engName;
    }

    public void setEngName(String value) {
        this.engName = value;
    }

    @Column(name = "CAS_NO", length = 128)
    public String getCasNo() {
        return this.casNo;
    }

    public void setCasNo(String value) {
        this.casNo = value;
    }

    @Column(name = "TYPE", length = 500)
    public String getType() {
        return this.type;
    }

    public void setType(String value) {
        this.type = value;
    }

    @Column(name = "HAZARD_CHEMICAL_FLAG", length = 8)
    public String getHazardChemicalFlag() {
        return this.hazardChemicalFlag;
    }

    public void setHazardChemicalFlag(String value) {
        this.hazardChemicalFlag = value;
    }

    @org.springframework.data.annotation.CreatedBy
    @Column(name = "CREATE_BY")
    public Long getCreateBy() {
        return this.createBy;
    }

    public void setCreateBy(Long value) {
        this.createBy = value;
    }

    @org.springframework.data.annotation.CreatedDate
    @Column(name = "CREATE_TIME")
    public java.time.LocalDateTime getCreateTime() {
        return this.createTime;
    }

    public void setCreateTime(java.time.LocalDateTime value) {
        this.createTime = value;
    }

    @org.springframework.data.annotation.LastModifiedBy
    @Column(name = "UPDATE_BY")
    public Long getUpdateBy() {
        return this.updateBy;
    }

    public void setUpdateBy(Long value) {
        this.updateBy = value;
    }

    @org.springframework.data.annotation.LastModifiedDate
    @Column(name = "UPDATE_TIME")
    public java.time.LocalDateTime getUpdateTime() {
        return this.updateTime;
    }

    public void setUpdateTime(java.time.LocalDateTime value) {
        this.updateTime = value;
    }

    @Column(name = "DELETE_FLAG", length = 2)
    public String getDeleteFlag() {
        return this.deleteFlag;
    }

    public void setDeleteFlag(String value) {
        this.deleteFlag = value;
    }

    @Column(name = "CHEM_PRODUCT_TYPE", length = 10)
    public Long getChemProductType() {
        return chemProductType;
    }

    public void setChemProductType(Long chemProductType) {
        this.chemProductType = chemProductType;
    }

    @Column(name = "FUNCTIONS", length = 10)
    public Long getFunctions() {
        return functions;
    }

    public void setFunctions(Long functions) {
        this.functions = functions;
    }

    @Column(name = "MAX")
    public String getMax() {
        return max;
    }

    public void setMax(String max) {
        this.max = max;
    }

    @Column(name = "STORAGE_TYPE")
    public String getStorageType() {
        return storageType;
    }

    public void setStorageType(String storageType) {
        this.storageType = storageType;
    }
//
//    @Column(name = "MAX")
//    public String[] getMax() {
//        return max;
//    }
//
//    public void setMax(String[] max) {
//        this.max = max;
//    }


    @Override
    public String toString() {
        return "MhMajorHazardChemProduct{" +
                "id=" + id +
                ", tenentId=" + tenentId +
                ", orgCode='" + orgCode + '\'' +
                ", code='" + code + '\'' +
                ", name='" + name + '\'' +
                ", alias='" + alias + '\'' +
                ", engName='" + engName + '\'' +
                ", casNo='" + casNo + '\'' +
                ", type='" + type + '\'' +
                ", hazardChemicalFlag='" + hazardChemicalFlag + '\'' +
                ", createBy=" + createBy +
                ", createTime=" + createTime +
                ", updateBy=" + updateBy +
                ", updateTime=" + updateTime +
                ", deleteFlag='" + deleteFlag + '\'' +
                ", state=" + state +
                ", attachmentId=" + attachmentId +
                ", chemProductType=" + chemProductType +
                ", functions=" + functions +
                ", max='" + max + '\'' +
                ", storageType='" + storageType + '\'' +
                ", yearlyProductionCapacity='" + yearlyProductionCapacity + '\'' +
                ", gasYearlyProductionCapacity='" + gasYearlyProductionCapacity + '\'' +
                ", yearlyMax='" + yearlyMax + '\'' +
                ", gasYearlyMax='" + gasYearlyMax + '\'' +
                '}';
    }

    public int hashCode() {
        return new HashCodeBuilder().append(getId()).toHashCode();
    }

    public boolean equals(Object obj) {
        if (obj instanceof MhMajorHazardChemProduct == false)
            return false;
        if (this == obj)
            return true;
        MhMajorHazardChemProduct other = (MhMajorHazardChemProduct) obj;
        return new EqualsBuilder().append(getId(), other.getId()).isEquals();
    }
}
